<?php
use yii\helpers\Html;
use backend\widgets\common\LinkPages;
$this->registerJsFile('/status/js/table_base.js',[ 'depends'=> 'backend\assets\AppAsset']);
?>
<style>
	table tbody tr th{text-align: center; background-color: #FC9D9A; color: #fff;}
	table tbody tr td{text-align: center;}
	table tbody tr td img{width: 100px;height: 100px;}
	.page{float: right}
</style>
<div class="ibox-title">
	<h5>图片列表</h5>
</div>
<div class="ibox-content timeline">
	<div class="box-create">
		<?= Html::a('添加图片', ['add'], ['class' => 'btn btn-primary langse'])?>
		<!--<a href="#" class="btn btn-primary langse">
			<span>添加角色</span></a>-->
	</div>
	<?php if(Yii::$app->session->hasFlash('info')){ echo Yii::$app->session->getFlash('info'); } ?>
	<table class="table  table-bordered" style="background:#fff; margin-top:20px;"  align="center">
		<tr>
			<th>#</th>
			<th>图片</th>
            <th>标题</th>
            <th>操作</th>
		</tr>
		<?php  foreach($images as $val){ ?>
		<tr>
            <td class="center"><?= $val['id']?></td>
            <td class="center"><img src="<?= '/'.$val['thumb']?>"alt=""></td>
            <td class="center"><?=$val['title']?></td>
			<td class="center">
                <?= Html::a('删除', ['del', 'id' => $val['id']], [
                    'data' => [
                    'confirm' => '确认要删除吗？',
                    'method'  => 'post',
                    ],
                    'class'=> 'btn btn-danger',
                ])?>
	        </td>
		</tr>
	<?php } ?>
	</table>
	<div class="page"><?=LinkPages:: widget(['pagination' => $pager, 'prevPageLabel' => '&#8249', 'nextPageLabel' => '&#8250']);?></div>

</div>
<?php
	$js =<<<JS

JS;
$this->registerJs($js);
?>
